package com.kara.webapp.util;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import org.apache.tapestry5.OptionGroupModel;
import org.apache.tapestry5.OptionModel;
import org.apache.tapestry5.util.AbstractSelectModel;
import org.appfuse.model.LabelValue;

public class LabelValueSelectModel <T extends LabelValue> extends AbstractSelectModel {

	private List<OptionModel> options = null;
	
	public LabelValueSelectModel(Collection<T> items) {
		options = new ArrayList<OptionModel>();
		for (T item : items){
			OptionModel model = new LabelValueModel<LabelValue>(item);
			options.add(model);
		}
	}
	
	public List<OptionGroupModel> getOptionGroups() {
		return null;
	}

	public List<OptionModel> getOptions() {
	  
		return options;
	}	
}
